package libs.yzx.zaza.acts3;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import java.util.ArrayList;

import libs.yzx.zaza.R;
import libs.yzx.zaza.util.GunLunView;

/**
 * Created by Administrator on 2016/10/18
 */
public class GunLunViewActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gunlun_view);

        final GunLunView gv = (GunLunView) findViewById(R.id.gunlunview);
        gv.setUI(Color.rgb(0x44,0x44,0x44),Color.GREEN);
        ArrayList<String> list = new ArrayList<>(20);
        for (int i = 0; i < 20; i++) {
            list.add(i+"__"+i);
        }
        gv.setList(list);
        gv.setSelected("15__15");

        findViewById(R.id.btn).setOnClickListener(new View.OnClickListener(){
            public void onClick(View v) {
                Toast.makeText(GunLunViewActivity.this, gv.getSelected(), Toast.LENGTH_SHORT).show();
            }
        });
    }

}
